package com.yoomiito.app.ui.order.sureorder.shopcar;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.FragmentManager;
import android.widget.FrameLayout;

import com.yoomiito.app.R;
import com.yoomiito.app.base.BaseActivity;
import com.yoomiito.app.utils.AllCode;
import com.yoomiito.app.utils.EventMessage;
import com.yoomiito.app.utils.L;

import butterknife.BindView;

public class ShopCarActivity extends BaseActivity {

    @BindView(R.id.frameLayout)
    FrameLayout mFrameLayout;


    @Override
    public int getLayoutId() {
        return R.layout.act_shop_car;
    }

    @Override
    public Object newP() {
        return null;
    }

    public static void start(Context context){
        Intent intent = new Intent(context, ShopCarActivity.class);
        context.startActivity(intent);
    }

    @Override
    public void initData(Bundle savedInstanceState) {

        FragmentManager fm = getSupportFragmentManager();
        fm.beginTransaction()
                .add(R.id.frameLayout,new ShopCarFragment())
                .commitAllowingStateLoss();
    }

    @Override
    public void eventMessage(EventMessage eventMessage) {
        super.eventMessage(eventMessage);
        L.i("购物车--收到信息000");

        if (AllCode.BuyComplete.equals(eventMessage.getEventType())){
            finish();
        }
    }
}
